package com.harisucici.websocketlib.utils;

import java.util.HashMap;
import java.util.Map;

public class Constants {

    // 用户登录后立即拉取左侧会话列表信息
    public final static String SESSION_LIST = "SESSION_LIST";

    // 拉取会话聊天记录(历史聊天记录)
    public final static String CURRENT_SESSION = "CURRENT_SESSION";


    // 描述：会话列表右键执行置顶操作
    public final static String SESSION_SET_TOP = "SESSION_SET_TOP";

    // 发送单聊消息
    public final static String P2P = "P2P";
//    public final static String P2P = "APP_P2P";

    // 发送群聊消息
    public final static String GROUP = "GROUP";

    //消息发送状态
    public final static int UN_SEND = 2;
    public final static int SENDING = 1;
    public final static int SENDED = 0;

    //创建新会话-单聊
    public final static String ADD_SESSION_TO_SESSION_LIST = "ADD_SESSION_TO_SESSION_LIST";

    public final static String NORMAL = "NORMAL";
    public final static String TEXT = "TEXT";
    public final static String IMAGE = "IMAGE";
    public final static String VIDEO = "VIDEO";
    public final static String SYSTEM = "SYSTEM";
    public final static String AUDIO = "AUDIO";
    public final static String LINK = "LINK";

    public final static int NORMAL_CODE = 0;
    public final static int TEXT_CODE = 1;
    public final static int IMAGE_CODE = 2;
    public final static int VIDEO_CODE = 3;
    public final static int SYSTEM_CODE = 4;
    public final static int AUDIO_CODE = 5;
    public final static int LINK_CODE = 6;

    public static final Map<String, Integer> MSG_TYPE = new HashMap<String, Integer>() {
        {
            put(NORMAL, NORMAL_CODE);
            put(TEXT, TEXT_CODE);
            put(IMAGE, IMAGE_CODE);
            put(VIDEO, VIDEO_CODE);
            put(SYSTEM, SYSTEM_CODE);
            put(AUDIO, AUDIO_CODE);
            put(LINK, LINK_CODE);
        }
    };


    public static final String API = "api";
    public static final int THREADS = 5;
    public final static int MAX_NUM = 5;       // 最大重连数
    public final static int MILLIS = 5000;     // 重连间隔时间，毫秒
    public final static int WEB_CODE_OK = 200;
    public static long ReadTimeout = 60;
    public static long WriteTimeout = 60;
    public static long ConnectTimeout = 60;
}
